<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
  layout:decorator="layouts/layout" th:with="header='其他物料出库', subtext='管理系统中其他物料出库'" style="overflow: hidden;">

<head>
  <title>其他物料出库单</title>
</head>
<body style="overflow: hidden;">

  <th:block layout:fragment="content">
    <div  id="query-area" class="box-body m-b-sm border-bottom">
      <form class="form-horizontal search-form" role="form">
        <div class="row">

          <div class="col-sm-3">
            <div class="form-group">
              <label class="control-label col-sm-3">外部单号</label>
              <div class="col-sm-9">
                <input type="text" id="refDocnum" name="refDocnum" placeholder="输入外部单号搜索" class="form-control" />
              </div>
            </div>
          </div>

          <div class="col-sm-3">
            <div class="form-group">
              <label class="control-label col-sm-3">生产订单</label>
              <div class="col-sm-9">
                <input type="text" id="refAsnnum" name="refAsnnum" placeholder="输入生产订单号搜索" class="form-control" />
              </div>
            </div>
          </div>

          <div class="col-sm-3">
            <div class="form-group">
              <label class="control-label col-sm-3">订单WBS</label>
              <div class="col-sm-9">
                <input type="text" id="wbsDocnum" name="wbsDocnum" placeholder="输入订单WBS搜索" class="form-control" />
              </div>
            </div>
          </div>


          <div class="col-sm-3">
            <div class="form-group">
              <label class="control-label col-sm-3">出库单号</label>
              <div class="col-sm-9">
                <input type="text" id="docnum" name="docnum" placeholder="输入出库单号搜索" class="form-control" />
              </div>
            </div>
          </div>


          <div class="col-sm-3">
            <div class="form-group">
              <label class="control-label col-sm-3">分厂</label>
              <div class="col-sm-9">
                <input type="text" id="fatcode" name="fatcode" placeholder="输入分厂编码搜索" class="form-control" />
              </div>
            </div>
          </div>


          <div class="col-sm-3">
            <div class="form-group">
              <label class="control-label col-sm-3">产线</label>
              <div class="col-sm-9">
                <input type="text" id="lineNo" name="lineNo" placeholder="输入产线搜索" class="form-control" />
              </div>
            </div>
          </div>

          <div class="col-sm-3">
            <div class="form-group">
              <label class="control-label col-sm-3">工位</label>
              <div class="col-sm-9">
                <input type="text" id="stationNo" name="stationNo" placeholder="输入工位搜索" class="form-control" />
              </div>
            </div>
          </div>

          <div class="col-sm-3">
            <div class="form-group">
              <label class="control-label col-sm-3">配盘点</label>
              <div class="col-sm-9">
                <input type="text" id="sortLocCode" name="sortLocCode" placeholder="输入配盘点搜索" class="form-control" />
              </div>
            </div>
          </div>

          <div class="col-sm-3">
            <div class="form-group">
              <label class="control-label col-sm-3">物料编码</label>
              <div class="col-sm-9">
                <input type="text" id="material" name="material" placeholder="输入物料编码或名称搜索" class="form-control" />
              </div>
            </div>
          </div>

          <div class="text-left">
            <div class="col-sm-3">
              <div class="form-group">
                <label class="control-label col-sm-3">状态</label>
                <div class="col-sm-9">
                  <select name="workstatus" id="workstatus" class="form-control">
                    <option value="">请选择</option>
                    <option value="0000">创建单据</option>
                    <option value="0100">生成波次</option>
                    <option value="0300">完全分配</option>
                    <option value="0250">部分分配</option>
                    <option value="0650">部分拣选</option>
                    <option value="0700">出库完成</option>
                    <option value="0850">单据作废</option>
                    <option value="0880">关闭</option>
                  </select>

                </div>
              </div>
            </div>
          </div>


        <div class="row m-t">
          <div class="col-lg-12 seach-button">
            <div class="pull-right">
              <button type="submit" id="search" class="btn btn-primary">
                <i class="fa fa-search"></i> 搜索
              </button>
              <button type="reset" id="clear" class="btn btn-default">
                <i class="fa fa-remove"></i> 清除
              </button>
            </div>
          </div>
        </div>
        </div>
      </form>
    </div>

    <div class="row">
      <div class="col-lg-12">
        <div class="box">
          <div class="box-body">
            <h2>

             <a  class="btn btn-primary btn-sm" th:href="@{|${baseUrl}/add|}" th:title="添加发运订单">
               <i class="fa fa-fw fa-plus"></i> 添加
             </a>

              <!--
                          <a  class="btn btn-primary btn-sm alcAll" href="javascript:;" th:title="分配发运订单">
                            <i class="fa fa-fw fa-plus"></i> 分配
                          </a>
                          -->
                <a  class="btn btn-success btn-sm createWaveAll" href="javascript:;" th:title="合并波次">
                    <i class="fa fa-fw fa-plus"></i> 合并波次
                </a>
                <a  class="btn btn-info btn-sm addToWaveAll" href="javascript:;" th:title="逐一波次">
                  <i class="fa fa-edit"></i> 逐一波次
                </a>
              <a  class="btn btn-warning btn-sm closeAll" href="javascript:;" th:title="关闭发运订单">
                <i class="fa fa-remove"></i> 关闭
              </a>
              <a  class="btn btn-danger btn-sm delAll" href="javascript:;" th:title="删除发运订单">
                <i class="fa fa-fw fa-trash"></i> 删除
              </a>
            </h2>
            <div id="tableWrapper">
              <table id="table" class="table table-striped table-hover table-bordered table-fixed">
                <thead style="position:sticky;top:0;z-index:10;">
                <tr>
                  <th style="width:50px;">
                    <a href="javascript:;" class="selectAll" title="全选">全选</a>
                  </th>


                    <th style="width:100px;">出库单号</th>
                    <th style="width:80px;">类型</th>
                    <th style="width:100px;">外部单号</th>
                    <th style="width:100px;">生产订单号</th>
                    <th style="width:160px;">订单WBS</th>
                    <th style="width:60px;">分厂</th>
                    <th style="width:80px;">产线</th>
                    <th style="width:160px;">工位</th>
                    <th style="width:60px;">配盘点</th>
                    <th style="width:80px;">波次</th>
                    <th style="width:60px;">详情</th>
                    <th style="width:60px;">来源</th>
                    <th style="width:140px;">创建时间</th>
                    <th style="width:80px;">状态</th>
                    <th style="width:120px;">备注</th>
                    <th style="width:60px;">操作</th>

                  </tr>
                </thead>
                <tbody>
                </tbody>
              </table>
            </div>
          </div>
        </div>
      </div>
    </div>

    <form id="delForm" method="post" style="display: none" th:action="@{|${baseUrl}/del|}">
      <input id="ids" type="hidden" name="ids" />
    </form>

    <form id="createWaveForm" method="post" style="display: none" th:action="@{|${baseUrl}/createwave|}">
          <input id="ids" type="hidden" name="ids" />
    </form>

    <form id="addToWaveForm" method="post" style="display: none" th:action="@{|${baseUrl}/addtowave|}">
          <input id="ids" type="hidden" name="ids" />
    </form>

    <form id="alcForm" method="post" style="display: none" th:action="@{|${baseUrl}/allocate|}">
      <input id="ids" type="hidden" name="ids" />
    </form>

    <form id="closeForm" method="post" style="display: none" th:action="@{|${baseUrl}/close|}">
      <input id="ids" type="hidden" name="ids" />
    </form>

    <!-- Modal -->
    <div class="modal fade" id="otsoDetailModal" tabindex="-1">
      <div class="modal-dialog" style="width:90%;">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <h4 class="modal-title">订单详情</h4>
          </div>
          <div class="modal-body">
            <iframe style="width: 100%; height: 450px;" frameborder="0"></iframe>
          </div>

        </div>
      </div>
    </div>

  </th:block>

  <th:block layout:fragment="scripts">
    <script th:inline="javascript">
      var VALUES_MAP_DICT_TYPE = /*[[${@CODES.valuesMapOfType('SO_TYPE')}]]*/ {};
      var VALUES_MAP_DICT_STATUS = /*[[${@CODES.valuesMapOfType('SO_STATUS')}]]*/ {};
    </script>
    <script th:src="@{|${theme}/js/app/outbound/otso_list.js?v=${applicationVersion}|}" th:inline="javascript"></script>
  </th:block>
</body>

</html>
